<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	request.setCharacterEncoding("UTF-8");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>水软考勤管理系统</title>
<link href="<%=request.getContextPath() %>/css/login_css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=path%>/dwr/interface/dlyhService.js"></script>
<script type="text/javascript" src="<%=path%>/dwr/engine.js"></script>
<script type="text/javascript" src="<%=path%>/dwr/util.js"></script>
<script type="text/javascript">
var srcUrl = "<%=request.getContextPath()%>/";
//用户名验证
function checkYhm()
{
   if(document.getElementById("yhm").value==""){
	alert("用户名不能为空!"); 	
     return false;
   }
     return true;
}
//密码验证
function checkMima(){
   if(document.getElementById("mima").value==""){
	  alert("密码不能为空!"); 
	  return false;
   }
    return true;
}
//提交
function doSubmit()
{   
	//
	var name = document.getElementById("yhm").value;
	var mima = document.getElementById("mima").value;
	if(checkYhm()&&checkMima())
	{  
	    DWREngine.setAsync(false);
	    dlyhService.checkUser(name,mima,function (flag){
	   if(flag == 'true'){
		   document.forms[0].action="<%=path%>/qxgl/loginAction.do";
		   document.forms[0].submit();
		}else{
		  alert("用户名或密码错误请重新输入！");
		  document.getElementById("yhm").focus();
		}
	  });
	}
}
//按回车键提交
function enterSubmit()
{
	if(event.keyCode==13)
	{
		doSubmit();
	}
}
//页面关闭
function winClose()
{
	window.returnValue = "ok";
	window.close();
}
//表单reset
function formReset()
{
	document.forms[0].reset();
}	
</script>
</head>
<body>
<form action="" method="post">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" >
    <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td valign="top" class="bgmid">
                        <div id="l_top">
                            <div id="l_top_1"><img src="<%=path%>/images/img_ht_wz_dl_6.gif" alt="logo" /></div>
                            <div id="l_top_2"><img src="<%=path%>/images/img_ht_wz_dl_8.gif" alt="logo" /></div>
                        </div>
				        <table border="0" align="center" cellpadding="0" cellspacing="0">
							 <tr>
								 <td width="150" height="20">&nbsp;</td>
				                 <td width="270" align="left" valign="bottom"></td>
							 </tr>
			                 <tr>
			                      <td width="150" height="56">&nbsp;</td>
			                  	  <td width="270">
									<div id="l_mid" >
									<ul>
									<li>用户名：<input id="yhm" name="dlyhBean.yhm"  size="20" maxlength="30"  value="" onfocus="this.style.borderColor='#68A6F5'" class="inp_02" onkeydown="enterSubmit()" ></input>
								    </li>
									<li>密&nbsp;&nbsp;&nbsp;&nbsp;码：<input type="password" id="mima" value="" name="dlyhBean.mima"  size="20" onfocus="this.style.borderColor='#68A6F5'"  class="inp_02" onkeydown="enterSubmit()"/>
									</li>
									</ul>
									</div>
							     </td>
			                </tr>
				            <tr>
								 <td width="150" height="20"></td>
				                 <td width="270">
				            
				                 </td>
							</tr>
                        </table>
                        <div id="l_botall">
                            <div id="l_but"><a href="#" onclick="doSubmit();"><img src="<%=path%>/images/img_ht_wz_dl_13.gif" alt="登录" border="0" /></a>
                            &nbsp;&nbsp;&nbsp;<a href="#" onclick="formReset()"><img src="<%=path%>/images/img_ht_wz_dl_15.gif" alt="重填" border="0" /></a></div>
                            <div id="l_bot"><a href="http://www.fulitong.com.cn" target="_blank">北京水软技术有限公司</a></div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td height="30">&nbsp;</td>
                </tr>
            </table>
        </td>
    </tr>
</table>
</form>
</body>
<script language="javascript">  
   document.getElementById("yhm").focus();
</script>
</html>
